fWord Library thoughts

I'm developing a library to control MS-Word. Anybody got suggestions for features I would want to turn off when exporting to word?

//***************************************************************
bool    fWord_OleOK(string in_ErrMess)
{     // If there is an error then <<deal with it>> and return false
        // If there is no error then                      return true
        // This function is intended as a wrapper to the various "ole" commands that return string error messages
        //      e.g. if (!fWord_OleOK(oleMethod (oaoDocs, "Add", oaaArgs, oaoDocNew)))
        //           then error
        //           else proceed
//<<code stubbed>>  Landale deals with it in a complicated way
if (!null in_ErrMess) print "OLE command error: '" in_ErrMess "'\n"
return(!null in_ErrMess)
}     // end fWord_OleOK()
 
//***************************************************************
bool    fWord_Spelling(OleAutoObj in_oaoDocs, bool in_OnOff)
{     // For the given Word "Documents" Object, turn Spelling and Grammar either On or Off
        // Return whether it seemed to work
        if (null in_oaoDocs)            return(false)
 
        OleAutoObj      oaoOpts = null
        bool            Result  = false
 
        oleGet(in_oaoDocs, "Options", oaoOpts)
        if (!null oaoOpts)
        {  if (fWord_OleOK(olePut(oaoOpts, "CheckSpellingAsYouType", in_OnOff))     and
               fWord_OleOK(olePut(oaoOpts, "CheckGrammarAsYouType",  in_OnOff)))      //
           then Result  = true
           else Result  = false
           oleCloseAutoObject(oaoOpts)
        }
        else Result     = false
        return(Result)
}     // end fWord_Spelling()
 
 
//***************************************************************
bool    fWord_OptionsOff(OleAutoObj in_oaoDocs)
{     // For the given Word "Documents" Object, turn off the various Word options
        //      Spelling, Grammar, Track Revisions, Show Revisions
        // Return whether it seemed to work
        if (null in_oaoDocs)            return(false)
 
        OleAutoObj      oaoOpts = null
        bool            Result  = false
 
        oleGet(in_oaoDocs, "Options", oaoOpts)
        if (!null oaoOpts)
        {  if (fWord_OleOK(olePut(oaoOpts, "CheckSpellingAsYouType", false))        and
               fWord_OleOK(olePut(oaoOpts, "CheckGrammarAsYouType",  false))  and
               fWord_OleOK(olePut(oaoOpts, "TrackRevisions",         false))  and
               fWord_OleOK(olePut(oaoOpts, "ShowRevisions",          false))) //
           then Result  = true
           else Result  = false
           oleCloseAutoObject(oaoOpts)
        }
        else Result     = false
        return(Result)
}    // end fWord_OptionsOff()


-Louie


llandale - Fri Feb 15 09:41:27 EST 2013

Re: fWord Library thoughts
Mathias Mamsch - Mon Feb 18 05:49:24 EST 2013

I think there are issues with pagination, so you could try to turn it of, or switch to a view without pagination. I think nobody has yet done a test which options do really make a difference for exporting. You could set up a test script, which does a standard export and measures the speed for the export with different settings.

Regards, Mathias

Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Re: fWord Library thoughts
SystemAdmin - Mon Feb 18 15:31:43 EST 2013

Disabling the "Allow Background Saves" option or temporarily increasing the time between auto-saves should contribute a little towards improved performance
Paul Miller,
Melbourne, Australia

Re: fWord Library thoughts
SystemAdmin - Tue Feb 19 04:19:22 EST 2013

Hello Louie,

In a recent project we used the following options to improve speed of an export:
 

WEXP_wordOptions<-"CheckSpellingAsYouType"  = false
    WEXP_wordOptions<-"CheckGrammarAsYouType"   = false
    WEXP_wordOptions<-"AllowFastSave"           = false
    WEXP_wordOptions<-"BackgroundSave"          = false
    WEXP_wordOptions<-"SaveInterval"            = 0
 
    // switch to Word Master View
    WEXP_objView<-"Type" = wdMasterView

 


Opening Word invisibly increased speed, but some things tended not to work (I think some fields were not updated correctly)

Regards,
Mike